package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.Brand;
import org.nf.shopping.mapper.BrandMapper;
import org.nf.shopping.service.BrandService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-12
 */
@Service
@RequiredArgsConstructor
public class BrandServiceImpl implements BrandService {

    private final BrandMapper brandMapper;
    @Override
    public PageInfo<Brand> listBrand(Integer pageSize, Integer pageNum, String name) {
        List<Brand> list = brandMapper.listBrand(pageSize,pageNum,name);
        PageInfo<Brand> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateBrand(Brand brand) {
        brandMapper.updateBrand(brand);
    }

    @Override
    public void deloneBrand(Integer id) {
        brandMapper.deloneBrand(id);
    }

    @Override
    public void addBrand(Brand brand) {
        brandMapper.addBrand(brand);
    }

    @Override
    public List<Brand> getBrandList() {
        return brandMapper.getBrandList();
    }
}
